package chpt04.shapes;

public class Shape {
	private int id;  // 用来唯一标识形状实例的id
	private int x;   
	private int y;
	
	public Shape() {
	}
	
	public Shape(int id, int x, int y) {
		this.id = id;
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	public double getArea() {
		return 0.0;
	}
	
	public double getPerimeter() {
		return 0.0;
	}
	
	public static double sumArea(Shape[] shapes) {
		double x = 0.0;
		for (Shape e : shapes) {
			x += e.getArea();
		}
		return x;
	}
}
